package com.aptemo.webetek.client.widgets.statistics;

import com.aptemo.webetek.shared.StatisticsBean;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class ApplicationStatistics
		extends Composite
{
	private static ApplicationStatisticsUiBinder	uiBinder	= GWT.create(ApplicationStatisticsUiBinder.class);

	interface ApplicationStatisticsUiBinder extends UiBinder<Widget, ApplicationStatistics>
	{
	}

	@UiField
	SpanElement	users;

	@UiField
	SpanElement	teams;

	@UiField
	SpanElement	activeBets;

	@UiField
	SpanElement	allBets;

	public ApplicationStatistics(StatisticsBean stats)
	{
		initWidget(uiBinder.createAndBindUi(this));

		users.setInnerText("" + stats.getNoOfUsers());
		teams.setInnerText("" + stats.getNoOfTeams());
		activeBets.setInnerText("" + stats.getNoOfActiveBets());
		allBets.setInnerText("" + stats.getNoOfAllBets());
	}

}
